package com.hyperfix.washer.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hyperfix.models.washer.dtos.RiskRecordDTO;
import com.hyperfix.models.washer.pojos.RiskRecord;
import com.hyperfix.models.washer.vos.RiskRecordQueryVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;

/**
 * @author JiangChunYu
 * 2024/4/25
 */
@Mapper
public interface RiskRecordMapper extends BaseMapper<RiskRecord> {
    IPage<RiskRecordDTO> listRiskRecordDTO(IPage<RiskRecordDTO> riskRecordDTOIPage, @Param("param") RiskRecordQueryVO riskRecordQueryVO);

    Integer count(@Param("start") LocalDateTime startOfToday, @Param("end") LocalDateTime endOfToday);

    Integer countByTeamId(@Param("teamId") Integer teamId,
                          @Param("start") LocalDateTime startOfToday,
                          @Param("end") LocalDateTime endOfToday);

    Integer countByStationId(@Param("stationId") Integer stationId,
                             @Param("start") LocalDateTime startOfWeek,
                             @Param("end") LocalDateTime endOfToday);
}
